package com.bdqn.crm.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public  class DataFormat {

    public static String forMat(String strDate){
        String pat1 = "yyyy-MM-dd HH:mm:ss";    //模板
        String pat2 = "yyyy-MM-dd";             //模板
        SimpleDateFormat sdf1 = new SimpleDateFormat(pat1);
        SimpleDateFormat sdf2 = new SimpleDateFormat(pat2);
        Date d = null;
        try {
            d = sdf1.parse(strDate);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return sdf2.format(d);
    }


}
